function FAS = fastat(type, sector_id, year_number, quarter)

switch (type)
    case 'normal'
        FI_temp = financial_indicator('sector & security',sector_id, year_number, quarter);
        %FI = cell2mat(FI_temp(2:end,3:end));
        if(isempty(FI_temp))
            FAS = [];
            return;
        end
        FI = FI_temp(2:end,4:end);
        Mean = mean(FI,1);
        Std = std(FI,0,1);
        Kurtosis = kurtosis(FI);
        Skewness = skewness(FI);
        Median = median(FI);
        Max = max(FI,[],1);
        Min = min(FI,[],1);
        Confidence_lv_95 = quantile(FI,0.95,1);
        Confidence_lv_5 = quantile(FI,0.05,1);
        FAS_id = [ones(9,1).*sector_id, ones(9,1).* year_number, ones(9,1)* quarter];
        FAS = [Mean;Std;Kurtosis;Skewness;Median;Max;Min;Confidence_lv_95;Confidence_lv_5];
        FAS = [FAS_id,FAS];
    case 'all quarter'
        FI = [];
        FAS = [];
        %para1 = cellstr(char('mean','std','kurtosis','skewness','median','max','min','95th quantile','5th quantile'));
        %para2 = cellstr(char('','ROE', 'ROA', 'EPS', 'PE', 'PB', 'gross_profit_margin', 'price_over_revenue'));
        for i= 1:4;    
           FI_temp = financial_indicator('sector & security',sector_id, year_number, i);
           if(isempty(FI_temp))
               continue;
           end
           FI = FI_temp(2:end,4:end);
           Mean = mean(FI,1);
           Std = std(FI,0,1);
           Kurtosis = kurtosis(FI);
           Skewness = skewness(FI);
           Median = median(FI);
           Max = max(FI,[],1);
           Min = min(FI,[],1);
           Confidence_lv_95 = quantile(FI,0.95,1);
           Confidence_lv_5 = quantile(FI,0.05,1);
           FAS_temp1 = [Mean;Std;Kurtosis;Skewness;Median;Max;Min;Confidence_lv_95;Confidence_lv_5];
           FAS = [FAS;ones(9,1).*sector_id, ones(9,1).* year_number, ones(9,1)* i, FAS_temp1];
           clear FI_temp
           clear FI
           clear mean
           clear std
           clear kurtosis
           clear skewness
           clear median
           clear max
           clear min
           clear confidence_lv_95
           clear confidence_lv_5
           clear FAS_temp1
        end
        FAS;
    case 'all year'
        FI = [];
        FAS =[];
        for j = 2000:year(now);%2000:year(now);
            for i = 1:4;
               try
                   FI_temp = financial_indicator('sector & security',sector_id, j, i);
                   if(isempty(FI_temp))
                       continue;
                   end
                   FI = FI_temp(2:end,4:end);
                   Mean = mean(FI,1);
                   Std = std(FI,0,1);
                   Kurtosis = kurtosis(FI);
                   Skewness = skewness(FI);
                   Median = median(FI);
                   Max = max(FI,[],1);
                   Min = min(FI,[],1);
                   Confidence_lv_95 = quantile(FI,0.95,1);
                   Confidence_lv_5 = quantile(FI,0.05,1);
                   FAS_temp1 = [Mean;Std;Kurtosis;Skewness;Median;Max;Min;Confidence_lv_95;Confidence_lv_5];
                   FAS = [FAS;ones(9,1).*sector_id, ones(9,1).* j, ones(9,1)* i,FAS_temp1];
                   clear FI_temp
                   clear FI
                   clear Mean
                   clear Std
                   clear Kurtosis
                   clear Skewness
                   clear Median
                   clear Max
                   clear Min
                   clear Confidence_lv_95
                   clear Confidence_lv_5
                   clear FAS_temp1
               catch err
                   fprintf('%s: %s \n',err.identifier,err.message);
               end
            end
        end
        
end